package ooseminar.length;

/**
 * Created by Abel Zhang.
 * User: twer
 * Date: Apr 18, 2011
 * Time: 6:12:51 PM
 */
public enum LengthUnit {
    MILLIMETER(1.0), METER(1000.0);
    private double factor;

    LengthUnit(double factor) {
        this.factor = factor;
    }

    public double convertTo(LengthUnit unit, double amount) {
        return amount * factor / unit.factor; 
    }
}
